package org.edu.modules.research.rbase.service.impl;

import org.edu.common.base.BasePageDto;
import org.edu.common.base.BaseServiceImpl;
import org.edu.common.utils.ConvertUtils;
import org.edu.common.base.BaseServiceImpl;
import org.edu.modules.research.rbase.mapper.VeJkyOrganizeUserMapper;
import org.edu.modules.research.rbase.entity.VeJkyOrganizeUser;
import org.edu.modules.research.rbase.dto.VeJkyOrganizeUserDto;
import org.edu.modules.research.rbase.service.VeJkyOrganizeUserService;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;


/**
 * 实现类
 */
@Service
public class VeJkyOrganizeUserServiceImpl extends BaseServiceImpl<VeJkyOrganizeUser, VeJkyOrganizeUserMapper> implements VeJkyOrganizeUserService {

    @Override
    public void deleteByOrgId(Integer orgId) {
        mapper.deleteByOrgId(orgId);
    }

    /**
    * 查询实体类
    */
    public VeJkyOrganizeUserDto findDtoById(String id) {
        VeJkyOrganizeUser entity = super.findById(id);
        VeJkyOrganizeUserDto dto = ConvertUtils.convertToDto(entity, VeJkyOrganizeUserDto.class);
        return dto;
    }

    /**
    * 新增或者修改
    */
    public void insertOrUpdate(VeJkyOrganizeUserDto dto,Boolean isAdd){
        if(isAdd){
            super.insert(dto);
        }else{
            super.update(dto);
        }
    }

}
